﻿using UnityEngine;
using System.Collections;

public class ParticleDestroyer : MonoBehaviour
{
	private ParticleSystem myParticleSystem;
	private Transform myTransform;

	void Start()
	{
		myParticleSystem = particleSystem;
		myTransform = transform;
	}

	void LateUpdate()
	{
		myTransform.position = PlayerController.instance.transform.position;
		if (!myParticleSystem.IsAlive())
		{
			Destroy(gameObject);
		}
	}
}